def day_month(year,month):
    # 判断闰年
    def leap_year(year):
        if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
            return True
        return False

    #是闰年且为二月，返回29天
    if(leap_year(year) and month == 2):
        return 29;

    # 月份天数
    month_day = [0, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

    return month_day[month]

year = int(input("请输入年份："))
month = int(input("请输入月份："))

print(f"{year}年{month}月有{day_month(year,month)}天")





